package com.liang.static_model;

/**
 * @Author:liangli
 * @Date:2020/11/17 14:39
 */
//静态代理
public class StaticProxy {
    public static void main(String[] args) {
        Weddingcompany weddingcompany=new Weddingcompany(new You());
        weddingcompany.HappyMarry();
    }
}

interface Marry{
    //人间四大喜事
    void HappyMarry();
}

//真实角色 你去结婚
class You implements Marry{

    public void HappyMarry() {
        System.out.println("我要结婚了，超开心");
    }
}

class Weddingcompany implements Marry{
    private  Marry target;
    public Weddingcompany(Marry target){
        this.target=target;
    }
    public void HappyMarry() {
        before();
        this.target.HappyMarry();
        after();
    }

    private void after() {
        System.out.println("结婚后收尾款");
    }

    private void before() {
        System.out.println("结婚之前布置现场");
    }
}